package client;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.swing.JFrame;

import socket.ClientSocket;
import thread.ServerMsgHandler;
import ui.ChatWin;
import ui.LoginWin;
import ui.RegistWin;
import ui.WindowTypes;

public class ClientEntry {
	public static Map<Integer, JFrame> windows = new HashMap<>();
	private static final String HOST = "127.0.0.1";
	private static final int PORT = 8081;
	
	public static void main(String[] args) throws IOException {
		
		ClientSocket.setHost(HOST);
		ClientSocket.setPort(PORT);
		
//		Map<Integer, JFrame> windows = new HashMap<>();
		windows.put(WindowTypes.REGIST_WIN, new RegistWin());
		windows.put(WindowTypes.LOGIN_WIN, new LoginWin());
		windows.put(WindowTypes.CHAT_WIN, new ChatWin());
		
		new Thread(new ServerMsgHandler(windows)).start();
	}
}
